const adminMod = require('../model/adminMod.js')
const { validateAccMOd } = require('../model/userMod.js')
// 该层处理数据库参数
const adminServ = {
  deleteAdmServ : async (data)=>{
    await adminMod.delelteAdmMod(data)
  },
  addAdmServ : async (data)=>{
    const code = await adminMod.validateAccMOd(data)
    if(code === 1) return {
      msg:'账号已存在！',
      code:1
    }
    await adminMod.addAdmMod(data)
    return {
      msg:'添加成功！',
      code:0
    }
  },
  selectAdmServ : async (data)=>{
   const res =  await adminMod.selectAdmMod(data)
    return res
  },
  editpwdWebServ : async (data)=>{
     await adminMod.editpwdWebMOd(data)
   },
}

module.exports = adminServ